import store from './../state';

export default (getState?: Function) => {
    getState = getState || store.getState;

    const {
        user
    } = getState() as any;

    const {
        loginUser
    } = user || {};

    const {
        userId = 0
    } = loginUser || {};

    return userId as  string | number;
}